<template>
  <div>
    <vm-common-header
      :pageTitle="pageTitle"
      :goBack="goBack"></vm-common-header>
    <div class="vm-myOffer-container" ref="warpper">
      <div class="content">
        <h5 class="bidding_number">
          招标编号：GG_20180522950
        </h5>
        <div
         class="vm-myOffer-item-box"
         v-for="(item, key) in offerData"
         :key="key">
            <div class="vm-myOffer-item-l">
              <div class="vm-myOffer-companyName">
                <span>公司名称：</span>
                <em>{{ item.cCompanyName }}</em>
              </div>
              <div class="vm-myOffer-offerTime">
                <span>报价时间：</span>
                <em>{{ item.RealTime }}</em>
              </div>
              <div class="vm-myOffer-enclosure">
                <span>附件</span>
                <div class="pl30">
                  <a :href="`http://www.vocoor.cn${item.Realinfofile}`">报价文件.xlsx</a>
                </div>
              </div>
            </div>
            <div class="vm-myOffer-item-r">
              <div class="vm-myOffer-totalMoney">
                <span>总价</span>
                <em class="money">￥{{ item.RealinfoTotal }}</em>
              </div>
              <!--<div class="vm-myOffer-moreOffer">-->
                <!--<router-link to="/common/vm_common_pretrial/123" tag="span">查看更多报价</router-link>-->
              <!--</div>-->
            </div>
          </div>
        <vm-common-noData v-if="!offerData.length"></vm-common-noData>
      </div>
    </div>
  </div>
</template>

<script>
  import BScroll from 'better-scroll'
  import vmCommonHeader from '@/components/vm-common-header' // header 组件
  import { Matchingpurchase_readvenderdetails } from '@/api/matching_purchase.js'
  export default {
    data () {
      return {
        pageTitle: this.$route.meta.pageTitle,
        goBack: this.$route.meta.goBack,
        rid: this.$route.query.rid, // 操作数据id
        offerData: new Array()
      }
    },
    created () {
      this.getReadvenderdetails();
    },
    methods: {
      getReadvenderdetails() {
        let rid = this.rid;
        console.log(rid);
        Matchingpurchase_readvenderdetails({rid})
          .then(res => res.data)
          .then(data => {
            this.offerData = data.data;
            console.log(this.offerData );
          })
      }
    },
    mounted () {
      this.$nextTick(() => {
        if ( !this.scroll ) {
          this.scroll = new BScroll(this.$refs.warpper,{
            click: true,   //是否派发click事件
            scrollbar: false
          });
        } else {
          this.scroll.refresh()
        }
      })
    },
    components: {
      'vm-common-header': vmCommonHeader,
    }
  }
</script>

<style scoped lang="scss">
  .vm-myOffer-container {
    height: 100%;
    padding: 0 40px;
    .bidding_number {
      display: flex;
      height: 88px;
      align-items: center;
      justify-content: flex-start;
      font-size: 26px;
      color: #000;
      font-weight: bold;
    }
  }

</style>
